#######################################
###########CONTENT ANALYSIS############
#######################################


#LOAD /INSTALL PACKAGES
pacman::p_load(
  foreign, reshape2, ggplot2, tidyverse, plyr, dplyr, ggpubr
)

setwd(dirname(rstudioapi::getActiveDocumentContext()$path))

#FIGURE1#
figure1<-read.dta("Figure1.dta")

figure1r<-rename(figure1, c("EXPART_APSR"="APSR", "EXPARTEJPRn"="EJPR"))

figure1m <- melt(figure1r, id = "YEAR")
figure1m <-rename(figure1m, c("variable"="Journal"))

figure<-ggplot(data = figure1m, aes(x = YEAR, y = value, colour = Journal, linetype = Journal, shape = Journal, group = Journal)) +
  scale_x_continuous(name="Years", limits=c(2000, 2019), breaks=seq(2000, 2019, by=1)) +
  scale_y_continuous(name="Number of articles", limits=c(0, 14), breaks=seq(0, 14, by=2)) +
  theme_bw() + theme(legend.position="bottom") +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1)) +
  geom_line(aes(linetype=Journal), size = 0.8) +
  scale_linetype_manual(values=c("solid", "dashed")) +
  scale_color_manual(values=c("firebrick2", "cornflowerblue")) +
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
        panel.background = element_blank(), axis.line = element_line(colour = "black")) +
  theme(axis.text=element_text(size=14),
        axis.title=element_text(size=14,face="bold")) +
  theme(
    legend.title = element_text(size = 14),
    legend.text = element_text(size = 14)
  )

ggsave("figure1.png", dpi = 600)
